home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0886.arc
/
SCHEME5.LTG
< prev
next >
Wrap
Text File
|
1986-04-21
|
3KB
|
66 lines
MAKING PC SCHEME FRIENDLY WITH WINDOWS AND SCHEME.INI
; File to open PC SCHEME session by clearing screen, opening a window for
; input and output of information to one's students. If compiled and made
; an .fsl file within SCHEME.INI, it will load and run automatically when
; PC SCHEME is invoked. User is prompted to clear window and if intro.s is
; part of SCHEME.INI, the prompt will be agreeably altered.
; This hopefully humorous example demonstrates the flexibility of PC SCHEME
; and the ease with which windows are created and manipulated. Popup windows
; are also available. Border and text attributes may be specified.
(windowclear 'console) ; clear default display
(define wind (makewindow "Hello, student!" #!true)) ;names window, boolean
;determines whether window
;will display border
(windowsetposition! wind 1 10) ;sets upperleft corner coordinates
(windowsetsize! wind 15 45) ;sets size
(let ((name '?)) ;opens for variable input of users' name
(begin
(windowclear wind) ;displays window to screen
(display "Welcome " wind) ;Prints string to screen without "
(newline wind) ;outputs endofline character sequence to window
(display "Enter your first name " wind)
(newline wind)
(set! name (readline wind)) ;reads in characters from keyboard
(display "Nice to meet you, " wind)
(display name wind)) ;inserts name given after "Nice to meet you, "
(newline wind)
(display "Here is information you will need:" wind)
(newline wind)
(display "1. I have no office hours. " wind)
(newline)
(display "2. My assistant is Fred Hacker." wind)
(newline)
(display "3. Call Fred with any problem." wind)
(newline wind)
(display "Good luck, " wind)
(display name wind))
(newline wind)
(display "Press any key to continue." wind)
(let ((key '?)) ; accepts any key and then deletes itself
(set! key (readchar wind))
(windowdelete wind))
CHANGE PROMPT
;;; One of the pleasures of PC SCHEME is its flexibility.
;;; If the prompt [x] is putting you to sleep, try this.
;;; Userfriendly details like this can easily be added to a
;;; SCHEME.INI file to load when the system is invoked.
(setfluid! schemetoplevel
(namedlambda (loop)
(newline)è (display "Your wish, gentle user?: ")
(write (eval (read)))
(loop)))
; SCHEME.INI file lists files to be loaded. Compiling and converting to fast;
load speeds execution.
(load "info.fsl")
(load "intro.fsl")